package uk.ac.cam.cl.projectcharlie2010.hardwaremove;

public class Status {
	
	private boolean ready;
	
	public Status() {
		ready = false;
	}
	
	public boolean isReady() {
		return ready;
	}
	
	public synchronized void setReady(boolean ready) {
		this.ready = ready;
		if (ready) {
			this.notifyAll();
		}
	}
	
	public void waitForReady() {
		if (!ready) {
			synchronized (this) {
				try {
					this.wait(20000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
	}
	
}
